aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/mass test client/Commands/WhoCommand.cs
blob: 3edb649a42c6c378bdf6ef2b2f08562b4f814ddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;

namespace libsecondlife.TestClient
{
    public class WhoCommand: Command
    {
        public WhoCommand(TestClient testClient)
		{
			Name = "who";
			Description = "Lists seen avatars.";
		}

        public override string Execute(string[] args, LLUUID fromAgentID)
		{
			StringBuilder result = new StringBuilder();
			foreach (Avatar av in Client.AvatarList.Values)
			{
				result.AppendFormat("\n{0} {1} {2}/{3} ID: {4}", av.Name, av.GroupName, 
                    (av.CurrentSim != null ? av.CurrentSim.Name : String.Empty), av.Position, av.ID);
			}

            return result.ToString();
		}
    }
}